//
//  AppDelegate.h
//  PokerPlus
//
//  Created by sunrui-MacBook on 11-7-29.
//  Copyright 2011 139.ME. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SocketEngine.h"
#import "LoginEventListener.h"

@interface AppDelegate : NSObject <UIApplicationDelegate> {

	
	SocketEngine * mainsocket;
	LoginEventListener * eventLogin;
	NSString *hostName;
	UInt16 port;
	UsrInfo currentUserInfo;
	BOOL enterBackground;
	
	int roomID;
}


@property (nonatomic, readonly) SocketEngine * mainsocket;
@property (nonatomic, readonly) LoginEventListener * eventLogin;
@property (nonatomic, readonly) NSString *hostName;
@property (nonatomic, readonly) UInt16 port;
@property int roomID;
-(UIView *) rootView;
+(AppDelegate *)sharedDelegate;
-(void)ServerConnected:(UIView *)viewtoremove;
-(void)cmdGetUserInfo:(SocketEngine *)socket;
//-(void)GetUserInfo:(SocketEngine *)socket withUserName:(NSString *)name andUserPSW:(NSString *)psw;
-(void) rsSetUserInfo:(SocketEngine *)socket ;

-(void)cmdGetRoomSort:(SocketEngine *)socket;
-(void)rsSetRoomSort:(SocketEngine *)socket;

-(void)cmdGetRoomList:(SocketEngine *)socket withRoomSort:(int)sort;
-(void)rsSetRoomList:(SocketEngine *)socket;

-(void)cmdGetRoomInfo:(SocketEngine *)socket withRoomId:(int)roomId;
-(void)rsSetRoomInfo:(SocketEngine *)socket;

-(void)cmdEnterRoom:(SocketEngine *)socket;
- (void)rsEnterRoom:(SocketEngine *)socket withResult:(BOOL)result;

-(void)cmdSitDown:(SocketEngine *)socket atIndex:(int)index;
- (void)rsSitDown:(SocketEngine *)socket withResult:(BOOL)result;

-(void)cmdStandUp:(SocketEngine *)socket atIndex:(int)index;
- (void)rsStandUp:(SocketEngine *)socket withResult:(BOOL)result;

-(void)rsRefreshGameInfo:(SocketEngine *)socket;
-(NSString *) getCurrentLanguage;
@end
